﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chinaer.IDao;

namespace Chinaer.Dao
{
    public class MenuCategoryDAO : IMenuCategoryDAO
    {
        public MenuCategoryDAO() { }
        public IMenuCategoryDAO menuCategoryDAO = new Chinaer.Dao.EF.MenuCategoryDAO();

        public bool EnableTrack
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public IList<Model.Entities.Model_MenuCategory> Query(string sql, int pageIndex, out int recordCount, int pageSize, params System.Data.SqlClient.SqlParameter[] sqlParams)
        {
            return menuCategoryDAO.Query(sql, pageIndex, out recordCount, pageSize, sqlParams);
        }

        public Model.Entities.Model_MenuCategory GetByID(string id)
        {
            try
            {
                return menuCategoryDAO.GetByID(id);
            }
            catch (Exception ex)
            {
                return null;
            }
        }

        public bool Exists(string id)
        {
            return menuCategoryDAO.Exists(id);
        }

        public bool Add(Model.Entities.Model_MenuCategory entity)
        {
            return menuCategoryDAO.Add(entity);
        }

        public bool Update(Model.Entities.Model_MenuCategory entity)
        {
            return menuCategoryDAO.Update(entity);
        }

        public bool Delete(Model.Entities.Model_MenuCategory entity)
        {
            return menuCategoryDAO.Delete(entity);
        }

        public bool Delete(string id)
        {
            return menuCategoryDAO.Delete(id);
        }

        public int DeleteByIDs(IList<string> listID)
        {
            return menuCategoryDAO.DeleteByIDs(listID);
        }


        public IList<Model.Entities.Model_MenuCategory> GetAll()
        {
            return menuCategoryDAO.GetAll();
        }


        public Model.Entities.Model_MenuCategory GetByName(string name)
        {
            return menuCategoryDAO.GetByName(name);
        }
    }
}
